﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PartsDialog.aspx.cs" Inherits="PartsDialog" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>库存零件名</title>

    <script type="text/javascript" language="javascript">
        function returnvalue() {

            var radobject = document.getElementById('<%= RadioButtonList1.ClientID %>').getElementsByTagName("input");
            //            var chkinput = document.getElementsByTagName("INPUT");
            var arrlength = radobject.length;
             
//            var arrlist = chkobject.ListValue.split(',');
            // alert(arrlength);
           for (var i = 0; i < radobject.length; i++) {
             if (radobject[i].type == "radio") {
                 if (radobject[i].checked) {
                     var str = radobject[i].value;
                     window.returnValue = str;
                   }
               }
           }

           window.close();
            
//                var str = chkobject.ListValue;
//            
//            window.returnValue = str
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:RadioButtonList ID="RadioButtonList1" runat="server" 
            DataSourceID="SqlDataSource1" DataTextField="column1" DataValueField="column2">
            
        </asp:RadioButtonList>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:4SDBConnectionString2 %>" 
            SelectCommand="SELECT [_partsName] AS column1, [_partsId] AS column2 FROM [Parts]">
        </asp:SqlDataSource>
        <input type="button" onclick="returnvalue()"  value="获取并关闭网页"/>
    </div>
    </form>
</body>
</html>
